package entity

import (
	"time"
	"wms/pb"
)

// SkuStock 库存终状态
type SkuStock struct {
	Mac         string         `gorm:"primaryKey;column:mac;type:varchar(32);not null"` //
	Iccid       string         `gorm:"column:iccid;type:varchar(32)"`                   //
	StockStatus pb.StockStatus `gorm:"column:stock_status;type:tinyint"`                // 最近状态1入库2出库
	WarehouseID int64          `gorm:"column:warehouse_id;type:bigint"`                 // 仓库主键
	SkuCode     string         `gorm:"column:sku_code;type:varchar(32)"`                //
	StockInAt   *time.Time     `gorm:"column:stock_in_at;type:datetime;default:NULL"`   //
	StockOutAt  *time.Time     `gorm:"column:stock_out_at;type:datetime;default:NULL"`  //
}

// TableName get sql table name.获取数据库表名
func (m *SkuStock) TableName() string {
	return "sku_stock"
}
